﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Tic1a10
    {
		private string _ceid;
		private string _ceappid;
		private string _ceautono;
		private string _cedono;
		private string _cesellerid;
		private string _ceshopid;
        private int? _cesubtype;
		private string _cesubtypedesc;
        private int? _cesubid;
		private double _ceamount;
		private double _ceamount2;
		private double _ceamount3;
		private string _ceremark;
		private string _ceusercode;
        private DateTime? _cecreatetime;
        private DateTime? _paytime;
		
        /// <summary>
        /// 主键
        /// </summary>
		public string Ceid
		{
			get { return _ceid;	 }
			set { _ceid=value;	}
		}
        /// <summary>
        /// 公司
        /// </summary>
		public string Ceappid
		{
			get { return _ceappid;	 }
			set { _ceappid=value;	}
		}
        /// <summary>
        /// 流水号
        /// </summary>
		public string Ceautono
		{
			get { return _ceautono;	 }
			set { _ceautono=value;	}
		}
        /// <summary>
        /// 单号
        /// </summary>
		public string Cedono
		{
			get { return _cedono;	 }
			set { _cedono=value;	}
		}
        /// <summary>
        /// 销售商
        /// </summary>
		public string Cesellerid
		{
			get { return _cesellerid;	 }
			set { _cesellerid=value;	}
		}
        /// <summary>
        /// 门店
        /// </summary>
		public string Ceshopid
		{
			get { return _ceshopid;	 }
			set { _ceshopid=value;	}
		}
        /// <summary>
        /// 往来类型
        /// </summary>
		public int? Cesubtype
		{
			get { return _cesubtype;	 }
			set { _cesubtype=value;	}
		}
        /// <summary>
        /// 类型名称
        /// </summary>
		public string Cesubtypedesc
		{
			get { return _cesubtypedesc;	 }
			set { _cesubtypedesc=value;	}
		}
        /// <summary>
        /// 项目
        /// </summary>
		public int? Cesubid
		{
			get { return _cesubid;	 }
			set { _cesubid=value;	}
		}
        /// <summary>
        /// 金额
        /// </summary>
		public double Ceamount
		{
			get { return _ceamount;	 }
			set { _ceamount=value;	}
		}
        /// <summary>
        /// 金额2
        /// </summary>
		public double Ceamount2
		{
			get { return _ceamount2;	 }
			set { _ceamount2=value;	}
		}
        /// <summary>
        /// 金额3
        /// </summary>
		public double Ceamount3
		{
			get { return _ceamount3;	 }
			set { _ceamount3=value;	}
		}
        /// <summary>
        /// 备注
        /// </summary>
		public string Ceremark
		{
			get { return _ceremark;	 }
			set { _ceremark=value;	}
		}
        /// <summary>
        /// 用户编码
        /// </summary>
		public string Ceusercode
		{
			get { return _ceusercode;	 }
			set { _ceusercode=value;	}
		}
        /// <summary>
        /// 创建时间
        /// </summary>
		public DateTime? Cecreatetime
		{
			get { return _cecreatetime;	 }
			set { _cecreatetime=value;	}
		}
        /// <summary>
        /// 付款日期
        /// </summary>
		public DateTime? Paytime
		{
			get { return _paytime;	 }
			set { _paytime=value;	}
		}
		
		public static List<Tic1a10> GetTic1a10ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Tic1a10> list = new List<Tic1a10>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Tic1a10 model = GetTic1a10ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Tic1a10 GetTic1a10ByDataRow(DataRow dr)
		{
			Tic1a10 model = new Tic1a10(); //实例化Tic1a10
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("ceid")&&!(dr["ceid"] is System.DBNull))  
				model.Ceid = ( string)dr["ceid"];
			if (dcc.Contains("ceappid")&&!(dr["ceappid"] is System.DBNull))  
				model.Ceappid = ( string)dr["ceappid"];
			if (dcc.Contains("ceautono")&&!(dr["ceautono"] is System.DBNull))  
				model.Ceautono = ( string)dr["ceautono"];
			if (dcc.Contains("cedono")&&!(dr["cedono"] is System.DBNull))  
				model.Cedono = ( string)dr["cedono"];
			if (dcc.Contains("cesellerid")&&!(dr["cesellerid"] is System.DBNull))  
				model.Cesellerid = ( string)dr["cesellerid"];
			if (dcc.Contains("ceshopid")&&!(dr["ceshopid"] is System.DBNull))  
				model.Ceshopid = ( string)dr["ceshopid"];
			if (dcc.Contains("cesubtype")&&!(dr["cesubtype"] is System.DBNull))  
				model.Cesubtype = ( int)dr["cesubtype"];
			if (dcc.Contains("cesubtypedesc")&&!(dr["cesubtypedesc"] is System.DBNull))  
				model.Cesubtypedesc = ( string)dr["cesubtypedesc"];
			if (dcc.Contains("cesubid")&&!(dr["cesubid"] is System.DBNull))  
				model.Cesubid = ( int)dr["cesubid"];
			if (dcc.Contains("ceamount")&&!(dr["ceamount"] is System.DBNull))  
				model.Ceamount = Convert.ToDouble(dr["ceamount"]);
			if (dcc.Contains("ceamount2")&&!(dr["ceamount2"] is System.DBNull))  
				model.Ceamount2 = Convert.ToDouble(dr["ceamount2"]);
			if (dcc.Contains("ceamount3")&&!(dr["ceamount3"] is System.DBNull))  
				model.Ceamount3 = Convert.ToDouble(dr["ceamount3"]);
			if (dcc.Contains("ceremark")&&!(dr["ceremark"] is System.DBNull))  
				model.Ceremark = ( string)dr["ceremark"];
			if (dcc.Contains("ceusercode")&&!(dr["ceusercode"] is System.DBNull))  
				model.Ceusercode = ( string)dr["ceusercode"];
			if (dcc.Contains("cecreatetime")&&!(dr["cecreatetime"] is System.DBNull))  
				model.Cecreatetime = ( DateTime)dr["cecreatetime"];
			if (dcc.Contains("paytime")&&!(dr["paytime"] is System.DBNull))  
				model.Paytime = ( DateTime)dr["paytime"];
			
			return model;
		}
    }
}
